import { axios } from '@/utils/request'

export function deleteFile(parameter) { //删除文件
  return axios({
    url: '/common/upload/deleteFile?name=' + parameter,
    method: 'get'
  })
}

export function addOrUpdate(parameter) { //提交表单
  return axios({
    url: '/face/advertisement/addOrUpdate',
    method: 'post',
    data: parameter
  })
}

export function selectList(parameter) { //查询服务商列表
  return axios({
    url: '/face/advertisement/selectList/' + parameter.pageNum + '/' + parameter.pageSize,
    method: 'post',
    data: parameter
  })
}

export function del(parameter) { //删除接口
  return axios({
    url: '/face/advertisement/delete/' + parameter,
    method: 'get'
  })
}

export function selectStoreByArea(parameter) { //通过区域编号查询门店信息
  return axios({
    url: '/face/advertisement/selectStoreByArea/' + parameter,
    method: 'get'
  })
}

export function selectStoreIdsByAdvertisementId(parameter) { //通过广告id查询已选中的门店
  return axios({
    url: '/face/advertisement/selectStoreIdsByAdvertisementId/' + parameter,
    method: 'get'
  })
}

export function selectAll(parameter) { //查询所有服务商列表
  return axios({
    url: '/face/serviceBusiness/selectAll',
    method: 'get'
  })
}

//商品上架下架
export function updateStatus(parameter) {
  return axios({
    url: '/face/advertisement/updateStatus',
    method: 'post',
    data: parameter
  })
}